<include file="Public:header" />
<body class="layout">
<div id="index" >
  <div class="head"> <img src="__ROOT__/App/Vote/Static/images/top.png"/> </div>
   <include file="Public:box" /> 
  <!-- 排行榜 -->
  <div class="rank"><!--  <img src="__ROOT__/App/Vote/Static/images/rank.png"> -->
  	<div class="rank-title">排行榜</div>
    <table  cellspacing="0">
      <thead>
      <th>名次</th>
        <th>编号</th>
        <th>宝贝名字</th>
        <th>票数</th>
          </thead>
      <tbody>
      </tbody>
    </table>
    <div class="showmore" onClick="pagelist()"> + 显示更多</div>
  </div>
</div>
<include file="Public:footer" /> 

<script charset="utf-8" type="text/javascript">
weixinShare({$signPackage},{$sharePackage});
var activityid = "{$_GET['activity_id']}";//活动ID
var k=1;//
$(function(){
	//提示转发信息
	$(".rule").click(function(){
		$(".rule-fixed").show();
	});
	pagelist();
});
//数据列表
function pagelist(){
	$.ajax({
			method: "post",
			dataType:"json",
			data: {
				'num':k,
				'activity_id' : activityid
		},
		url: "__URL__/rank",
		success  : function(data) {  
			$("tbody").html("");
			if(!data){
				return;
			}
			var tr = '';
			for(i=0;i<data.length;i++){
				tr+= "<tr><td>"+(i+1)+"</td><td>"+data[i].id+"</td><td>"+data[i].name+"</td><td>"+data[i].vote_num+"</td></tr>";
			}
			 $("tbody").append(tr);
		}
		
	});
	k++;
}
</script>
